<template>
  <div id="login-div">
    <div id="login-herder">欢迎使用北京尚学堂前后端分离案例系统</div>
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="用户名">
        <el-input v-model="form.username"></el-input>
      </el-form-item>


      <el-form-item label="密码">
        <el-input v-model="form.password" show-password></el-input>
      </el-form-item>


      <el-form-item>
        <el-button type="primary" @click="onSubmit">登录</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>


  </div>
</template>

<script>
export default {
  name: "Login",

  data() {
    return {
      form: {
        username: '',
        password: '',
      }
    }
  },
  methods: {
    onSubmit: function () {
      this.$router.push("/main")


/*
      this.$axios.post("/login", this.$qstring.stringify({
        username: this.form.username,
        password: this.form.password
      })).then(
          res => {
            if (res.data.status != 200) {
              this.$router.push("/main")
            } else {
              this.$message({
                message: res.data.msg,
                type: 'warning'
              });

            }
          }
      )
*/

    }
  }


}
</script>

<style scoped>
#login-div {
  width: 500px;
  margin: 0px auto;

}

#login-herder {
  text-align: center;
  font-size: 25px;
  font-family: sans-serif;
  padding: 15px;
  color: darkkhaki;
}
</style>